<template>
  <form-item :form-datas = "formDatas" :form-item = "field" :parent-comp-type = "parentCompType"
  >
    <el-rate :allow-half = "field.preps['allowHalf']"
             :clearable = "field.preps['clearable']"
             :colors = "field.preps['colors']"
             :disabled = "field.preps['disabled']"
             :disabled-void-color = "field.preps['disabledVoidColor']"
             :high-threshold = "field.preps['highThreshold']"
             :low-threshold = "field.preps['lowThreshold']"
             :max = "field.preps['max']"
             :score-template = "field.preps['scoreTemplate']"
             :show-score = "field.preps['showScore']"

             :show-text = "field.preps['showText']"
             :size = "field.preps['size']"
             :text-color = "field.preps['textColor']"
             :texts = "field.preps['texts']"
             :void-color = "field.preps['voidColor']"
             v-model = "starHorseDynamicForm[field.preps['name']]"
    />

  </form-item>
</template>

<script>
import FormItem from "./form-item";

export default {
  name: "rate-item",
  components: {FormItem},
  props: {
    parentCompType: {type: Object},
    starHorseDynamicForm: {type: Object},
    field: {
      type: Object
    },
    formDatas: {type: Object}
  },
  data() {
    let formItem = {label: "input", required: false};
    return {
      formItem,
      dataField: ""
    }
  },
  methods: {
    selectItem(data) {
      let _this = this;
      _this.$emit("selectItem", data, _this.parentCompType);
    }
  }
}
</script>

<style scoped>

</style>